package com.crscd.ai.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.crscd.ai.entity.Appointment;
import com.crscd.ai.mapper.AppointmentMapper;
import com.crscd.ai.service.AppointmentService;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 9/25/25 2:25 PM
 * @modifiedBy:
 * @version: 1.0
 */
@Service
public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appointment>
    implements AppointmentService {
  @Override
  public Appointment getOne(Appointment appointment) {
    LambdaQueryWrapper<Appointment> queryWrapper = new LambdaQueryWrapper<>();
    queryWrapper.eq(Appointment::getUsername, appointment.getUsername());
    queryWrapper.eq(Appointment::getIdCard, appointment.getIdCard());
    queryWrapper.eq(Appointment::getDepartment, appointment.getDepartment());
    queryWrapper.eq(Appointment::getDate, appointment.getDate());
    queryWrapper.eq(Appointment::getTime, appointment.getTime());
    return baseMapper.selectOne(queryWrapper);
  }
}
